<template>
  <div>
    <h2>App组件</h2>
    <p>使用state数据：{{ $store.state.user.age }}</p>
    <p>使用getters计算属性：{{ $store.getters['user/pingfang'] }}</p>
    <button @click="$store.commit('user/updateAge', 2)">让age+2</button><br />
    <button @click="$store.dispatch('user/updateAgeAfter3s', 1)">3秒后加1</button>

    <hr />

    <my-test></my-test>
  </div>
</template>

<script>
import MyTest from '@/components/MyTest.vue'
export default {
  components: {
    MyTest
  }
}
</script>

<style></style>
